<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>画布</title>
</head>
<style>

</style>
<script type="text/javascript">
    var c=document.getElementById("myCanvas");
    var cxt=c.getContext("2d");
    cxt.fillStyle="#FF0000";
    cxt.fillRect(0,0,150,75);
</script>
<body>
<canvas id="myCanvas" width="200" height="100" style="border: 1px solid red"></canvas>
</body>
</html>